<script>
	$(function(){
		$('#prize_tb').datagrid({
			columns:[[
			  		{field:'selected', checkbox:true },
			  	    {field:'lotteryperiod',title:'彩票期次',width:30, sortable:true,
			  			sorter:function(a,b){
			  				return (a>b?1:-1);
			  			}
			  		},
			  		{field:'typecode',title:'彩票类型',width:30},
			  		{field:'lotteryNumber1',title:'投注方式',width:25},
			  		{field:'lotteryNumber2',title:'倍数',width:15},
			  		{field:'lotteryNumber',title:'彩票号码',width:130},
			  		{field:'ticketamount',title:'购买注数',width:25},
			  		{field:'Validitytime',title:'有效时间',width:60},
			  		{field:'buytime',title:'购买时间',width:60},
			  		{field:'buyaddress',title:'购买点',width:60},
			  		{field:'prizeaddress',title:'兑奖点',width:60},
			  		{field:'prizetime',title:'兑奖时间',width:60},
			  		{field:'prizemoney',title:'中奖金额',width:30}
			  	]],
			  	toolbar:[
					{
						id:'export_awards',
						text:'返奖导出',
						iconCls:'icon-ok',
						handler: export_awards
					}
				],
			    onLoadError: function() {
			    	$.jBox.tip('没有数据或根据搜索条件查不到相关数据', 'info');
			    	$("div.datagrid-body").css("height",0).find("table > tbody").empty();
		    		$("div.datagrid-view").css("height",'23px');
		   	 	}
		});
	$('#prize_s').searchbox({
            width:300,  
            searcher:function(value,name){
            	var result = $('#prize_tb').datagrid('reload', {
        			query_key: name,
        			query_value: value
        		});
            },
            menu:'#prize_mm',  
            prompt:'请输入需要搜索的彩票期次'  
        });
	});
	
	function export_awards(){
		window.location.href = '/lottery/prize/prizelist/export';
	}

</script>


<div style="padding:20px;overflow:hidden;" class="ajust_height">
	<div style="padding-bottom:20px;overflow:hidden;">
		<input id="prize_s" value="{{periodid}}"></input>
		<div id="prize_mm" style="width:120px">
			<div name="20"  iconCls="icon-ok">时时彩</div>
			<div name="01"  iconCls="icon-ok">双色球</div>
			<div name="07"  iconCls="icon-ok">七乐彩</div>
			<div name="05"  iconCls="icon-ok">福彩3D</div>
			<div name="15"  iconCls="icon-ok">15选5</div>
			<div name="06"  iconCls="icon-ok">东方6+1</div>
		</div>
	</div>
	<table id="prize_tb" url="/lottery/prize/prizelist/data11" striped="true"
		pagination="true" iconCls="icon-save" url="" fitColumns="true" singleSelect="false"
		rownumbers="true" pageSize="15"   pageList=" [5,10,15,20,25]">
	</table>
</div>
